<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/html/MyTag.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="html/Style/skin.css" />	
     <script type="text/javascript" src="html/Js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript">
    	function state(obj){
    		var a=document.getElementById("a"+obj);
    		var span=document.getElementById("span"+obj);
    		var input=document.getElementById("input"+obj);
    			if(confirm("确认修改？")){
    				$.ajax({
						url:"conContent.do?method=updateContentState&vcontentId="+obj,
						type:"post",
						data:"state="+input.value,
						dataType:'json',
						success:function(d){
							if(d){
								if(input.value=="1"){
									a.innerHTML="重新分配";
									span.innerHTML="机会分配";
									input.value="0";
								}else{
									a.innerHTML="机会分配";
									span.innerHTML="重新分配";
									input.value="1";
								}	
							}
    					}
    				});
    			}
    	}
    	$(function(){
		
		$('#selectAll').on('click',function(){
			$('input[type=checkbox]').prop('checked',true);
			});
			
		$('#reverse').on('click',function(){
			$('input[type=checkbox]').each(function(index, element) {
				if($(this).prop('checked')){
					$(this).prop('checked',false);		
				}else {
					$(this).prop('checked',true);
				}
            	});
			});	
			
	});
    	
    </script>	        
</head>
    <body>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <!-- 头部开始 -->
            <tr>
                <td width="17" valign="top" background="html/Images/mail_left_bg.gif">
                    <img src="html/Images/left_top_right.gif" width="17" height="29" />
                </td>
                <td valign="top" background="html/Images/content_bg.gif">
                    <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" background="html/Images/content_bg.gif">
                        <tr><td height="31"><div class="title">客户资源</div></td></tr>
                    </table>
                </td>
                <td width="16" valign="top" background="html/Images/mail_right_bg.gif"><img src="html/Images/nav_right_bg.gif" width="16" height="29" /></td>
            </tr>
            <!-- 中间部分开始 -->
            <tr>
                <!--第一行左边框-->
                <td valign="middle" background="html/Images/mail_left_bg.gif">&nbsp;</td>
                <!--第一行中间内容-->
                <td valign="top" bgcolor="#F7F8F9">
                    <table style="width:100%" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <!-- 空白行-->
                        <tr><td colspan="2" valign="top">&nbsp;</td><td>&nbsp;</td><td valign="top">&nbsp;</td></tr>
						<tr>
							<td colspan="4">
								<form action="conContent.do?method=findConContentByPage" method="post" class="clearfix">
									<div style="float:left">
										<p style="float:left; margin-left:30px;">
											<label>客户姓名：</label><input name="contentName" class="text" style="width:80px;" list="emplist"  value="" />
											<input class="text" style="width:80px;"/>
										</p>&nbsp;&nbsp;&nbsp;
										<p style="float:left; margin-left:30px;">
										<label>客户电话：</label><input name="telephone" class="text" style="width:80px;" value="" />
										</p>&nbsp;&nbsp;&nbsp;
                                        <p style="float:left; margin-left:30px;"><label>操作时间：</label><input class="text" style="width:80px;"/> - <input class="text" style="width:80px;"/></p>&nbsp;&nbsp;&nbsp;
										<p style="float:left; margin-left:30px;"><input type="button" class="btn" value="查询"/></p>
									</div>
									<div style="float:right">
										<input type="button" onclick="window.location='conContent.do?method=updateContentBefore'" class="btn" value="添加"/> 
										<input type="button" class="btn" value="批量删除"/>										
									
									</div>
								</form>
							<td>
						</tr>
                        <!-- 一条线 -->
                        <tr>
                            <td height="40" colspan="4">
                                <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                                    <tr><td></td></tr>
                                </table>
                            </td>
                        </tr>
                        <!-- 列表展示开始 -->
                        <tr>
                            <td width="2%">&nbsp;</td>
                            <td width="96%">
                                <table width="100%">
                                    <tr>
                                        <td colspan="2">
                                            <form action="conContent.do" method="post">
                                                <table width="100%"  class="cont tr_color">
                                                    <tr>
                                                        <th>序号</th>
                                                        <th>选择</th>
                                                        <th>客户姓名</th>
                                                        <th>性别</th>
                                                        <th>客户类型</th>
														<th>分配状态</th>
														<th>录入时间</th>
                                                        <th>录入人</th>
                                                        <th>当前状态</th>
                                                        <th>操作</th>
                                                    </tr>
                                                    <c:forEach items="${pageUtil.list}" var="conContent" >
                                                    <tr align="center" class="d">
                                                    
                                                   		<td>${conContent.contentId}</td>
														<td><input type="checkbox" value="" /></td>
                                                        <td><a href="conContent.do?method=findConContentById">${conContent.consumername}</a></td>
                                                        <td><c:if test="${conContent.sex==1 }">男</c:if>
                                                        <c:if test="${conContent.sex==2 }">女</c:if></td>
                                                        <td><c:if test="${conContent.type==0 }">普通用户</c:if>
                                                        	<c:if test="${conContent.type==1 }">金卡用户</c:if>
                                                        	<c:if test="${conContent.type==2}">银卡用户</c:if>
                                                        	<c:if test="${conContent.type==3}">VIP用户</c:if></td>
                                                        <td><c:if test="${conContent.state==0 }">未分配</c:if>
                                                        	<c:if test="${conContent.state==1 }">已分配</c:if></td>
                                                        <td>${conContent.writeStringTime}</td>
														<td>${conContent.businessMan.name}</td>
														<td><c:if test="${conContent.KHstate==1}">启用</c:if>
                                                        	<c:if test="${conContent.KHstate==2}">禁用</c:if>
                                                        	<c:if test="${conContent.KHstate==3}">流失</c:if></td>
                                                        <td>
															<a href="/market/opp/assign.html">机会分配</a>&nbsp;&nbsp;
                                                        	<a href="conContent.do?method=updateConContent&empId=${contentId }">修改</a>&nbsp;&nbsp;
														</td>
                                                    </tr>
                                                    
                                                    
                                                    
                                                    </c:forEach>
                                                    
                                                    
                                                </table>
                                            </form>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="2%">&nbsp;</td>
                        </tr>
                        <!--列表展示结束 -->
                        <tr>
                            <td height="40" colspan="4">
                                <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                                    <tr><td></td></tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td width="2%">&nbsp;</td>
                            <td width="51%" class="left_txt">
                           		<input id="selectAll" type="button" value="全选" />&nbsp;&nbsp;&nbsp;
                                <input id="reverse" type="button" value="反选" />
                            <div style="float:right;"><b>
									<page:pagePrint url="conContent.do" key="nowPage" pageUtil="${pageUtil}"/>
								</b></div>	
                            
                            </td>
                            <td>&nbsp;</td><td>&nbsp;</td>
                        </tr>
                    </table>
                </td>
                <td background="html/Images/mail_right_bg.gif">&nbsp;</td>
            </tr>
            <!-- 底部部分 -->
            <tr>
                <td valign="bottom" background="html/Images/mail_left_bg.gif">
                    <img src="html/Images/buttom_left.gif" width="17" height="17" />
                </td>
                <td background="html/Images/buttom_bgs.gif">
                    <img src="html/Images/buttom_bgs.gif" width="17" height="17">
                </td>
                <td valign="bottom" background="html/Images/mail_right_bg.gif">
                    <img src="html/Images/buttom_right.gif" width="16" height="17" />
                </td>           
            </tr>
        </table>
    </body>
</html>
